﻿#region File and License Information
/*
<File>
	<Copyright>Copyright © 2009, Daniel Vaughan. All rights reserved.</Copyright>
	<License>
	This file is part of Daniel Vaughan's Core Library

    Daniel Vaughan's Core Library is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Daniel Vaughan's Core Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with Daniel Vaughan's Core Library.  If not, see http://www.gnu.org/licenses/.
	</License>
	<Owner Name="Daniel Vaughan" Email="dbvaughan@gmail.com"/>
	<CreationDate>2010-08-18 18:36:28Z</CreationDate>
</File>
*/
#endregion

using System;
using System.Windows.Controls;
using System.Windows.Navigation;

namespace DanielVaughan.Services.Implementation
{
	public class NavigationServiceWrapper : INavigationService
	{
		readonly NavigationService navigationService;

		public NavigationServiceWrapper(NavigationService navigationService)
		{
			this.navigationService = ArgumentValidator.AssertNotNull(navigationService, "navigationService");
		}

		public void GoBack()
		{
			navigationService.GoBack();
		}

		public void Navigate(Uri source)
		{
			navigationService.Navigate(source);
		}
	}

	public class FrameNavigationService : INavigationService
	{
		readonly Frame frame;

		public FrameNavigationService(Frame frame)
		{
			this.frame = ArgumentValidator.AssertNotNull(frame, "navigationService");
		}

		public void GoBack()
		{
			frame.GoBack();
		}

		public void Navigate(Uri source)
		{
			frame.Navigate(source);
		}
	}
}
